<script type="text/javascript">
function invitation_accepted() {
	$('invite_btn').hide();
	$("inviteForm").request({
		onComplete: function(transport){
			var ret = transport.responseText.evalJSON();
			if(ret.result){
				location.href = "/?" + $H({_app: 'friends', _controller: 'index', _action: 'get_list', friend: 1}).toQueryString();
			}else{
				MessageBox.showError(ret);
				$('invite_btn').show();
			}
		}
	});
}
</script>
<div class="content">
<div class="c_main">
<div class="fbox">
<div class="box">
<?if ($this->ret['result']):?>
<div class="b_title"><span class="darrow"></span><?= $this->ret['data']['username']?>邀请你成为<?=$this->getThe()?>的好友</div>
<div class="b_wrap">
<div class="gap25"></div>
	
	<div class="invate-show-message">
		<div class="invate-uhead">
			<div class="border"><img class="avatar" src="<?= avatar_util_saver::get_path($this->ret['data']['id'], 120)?>"/></div>
			<div class="u-home"><a href="/?uid=<?= $this->ret['data']['id']?>" target="_blank"><?= $this->getThe()?>的主页</a></div>
		</div><!--invate-uhead -->
		
		<div class="invate-mess">
			<div class="invate-mess-b">
		<? if($this->ret['data']['txt_armory']):?>
			<?= $this->ret['data']['txt_armory']?>
		<?else:?>
			<h2>来自艾泽拉斯国家地理及nga的一份邀请</h2>
			<p>Hi，我的战友，i.178.com是艾泽拉斯国家地理及nga的魔兽玩家社区，这里有各种各样的玩家，可能还有你几年前公会的会长。你在这里可以看到很多和魔兽相关好玩的功能与内容，等重要的你能在i.178.com和你的魔兽好友一起分享魔兽的点点滴滴。快点加入i.178.com个人社区，与我一同战斗！</p>
		<?endif;?>
				<div class="wow_info">
				<?if ($this->ret['data']['role']):?>
					<?php
						$fetcher = new armory_util_fetcher();
						$url = $fetcher->makeArmoryURL($this->ret['data']['role']['region'], $this->ret['data']['role']['realm'], $this->ret['data']['role']['cname']);
					?>
					<script type="text/javascript">
						var armory = new NewArmoryDisplay(<?= $this->ret['data']['role']['cdata']?>, '<?= $url?>', <?= $this->ret['data']['role']['id']?>);
						armory.write(armory.getIndexHtml());
					</script>
				<?endif;?>
				</div>
			</div>
			<div class="invate-mess-btn">
				<? if(Controller::$login):?>
					<form id='inviteForm' method="post" action="/">
	          		<input type='hidden' name='_app' value='friends'>
	          		<input type='hidden' name='_controller' value='invitation'>
	          		<input type='hidden' name='_action' value='invite'>
	          		<input type='hidden' name='uid' value='<?= $this->uid?>'>
	          		<input type='hidden' name='hash' value='<?= friends_util_invitation::genCode($this->getUid(), $this->ret['data']['code'], 2, $this->ret['data']['extra'], self::$login['uid'])?>'>
	                </form>
					<input type="button" value="接受邀请"  style="padding: 3px 15px;" class="bluebtn" onclick="javascript:void(invitation_accepted())" id='invite_btn'/>
				<? endif;?>
				<input type="button" value="注册并添加<?= $this->ret['data']['username']?>为好友"  style="padding: 3px 15px;" class="bluebtn" onclick="javascript:window.location.href='http://account.178.com/?p=register&to=<?= urlencode('http://'.$_SERVER['SERVER_NAME']."/".$_SERVER['REQUEST_URI'])?>'"/>
				
				<? if(!self::$login):?>
					<input type="button" value="登陆"  style="padding: 3px 15px;" class="bluebtn" onclick="javascript:window.location.href='http://account.178.com/?to=<?= urlencode('http://'.$_SERVER['SERVER_NAME']."/".$_SERVER['REQUEST_URI'])?>'"/>
				<? endif;?>
			</div>
			
			<? if(!self::$login):?>
				<div class="invite_clueon invate-f-tip">
					<div class="invite_clueon_arrowhead"></div><!--invite_clueon_arrowhead-->
					<div class="invite_clueon_text">如果你已经有了i.178.com的帐号，请点击 <a href="http://account.178.com/?to=<?= urlencode('http://'.$_SERVER['SERVER_NAME']."/".$_SERVER['REQUEST_URI'])?>">登陆</a></div><!--invite_clueon_text-->
			   	</div><!--invite_clueon-->
			<? endif;?>
			
		</div><!--invate-mess -->
	</div><!--invate-show-message -->

</div><!--b_wrap end-->
<?else:?>
<div class="tip-area">
	<span class="friend-tip">
		<span class="icon_btip"></span>
		该邀请链接失效或被删除				<div>  </div>
	</span>
</div> 
<?endif;?>
</div><!--box end-->
</div><!--fbox-->
</div><!--cmain end-->
</div><!--content end-->